#!/bin/bash

source /home/shell/util.sh

yum -y install yum-utils
yum-config-manager --add-repo http://mirrors.aliyun.com/repo/Centos-8.repo

if [ ! -f "/etc/yum.repos.d/epel.repo.backup" ]; then
    rpm -ivh http://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
    rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8

    cp -a /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
    mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
fi

sed -i "s/#baseurl/baseurl/g" /etc/yum.repos.d/epel.repo
sed -i "s/metalink/#metalink/g" /etc/yum.repos.d/epel.repo
sed -i "s@https\?://download.fedoraproject.org/pub@https://repo.huaweicloud.com@g" /etc/yum.repos.d/epel.repo
yum update -y

yum -y install gcc automake autoconf libtool make vim lrzsz sysstat yum-utils iftop sshpass expect redhat-lsb lvm2 gcc-c++
yum erase -y podman